﻿@using Controllers
@{
    var func=new MyFunc();
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@Html.Partial("_top")
</head>
<body>
@Html.Partial("_header")
<div id="cbanner" style="background:url('@ViewBag.model.cbanner') no-repeat center top;height:380px;width:100%;"></div>
<div class="position"><div class="box">您的当前位置：@Html.Raw(ViewBag.model.cur)</div></div>

<div class="sidebar box">
@Html.Partial("_left")

<script type="text/javascript">
$(function(){
	$("#cplb dl").each(function(){
	if($(this).attr("data-id")==@ViewBag.model.ID){
		$(this).addClass("on");
	}
	})
})
</script>
  <div class="sb_box">
    <h3 class="title">@ViewBag.model.title</h3>
        <div class="editor" id="piclist">
      <ul class='list-none'>
      				@{    var page = Request.QueryString["page"];// href="@url" title="@item.title" target="@target"
							int p = 1;
							int pagesize=ViewBag.model.info["model"].pnum;
							if (!string.IsNullOrEmpty(page))
							{
								p = Convert.ToInt32(page);
							}
							var pagelist=func.GetPageList(p,pagesize,ViewBag.model.ID);}
						@for (int i = 0; i < pagelist.Items.Count; i++)
						{
						var item=pagelist.Items[i];						
					var url=string.IsNullOrEmpty(item.url)?"/article/"+item.ID:item.url;
					var target=string.IsNullOrEmpty(item.url)?"_self":"_blank";
       <li>
				 <div class="img"><a href="@url" target="@target"><img src="@item.pic" alt="@item.title" hspace="0" vspace="0" border="0"/></a></div>
				 <div class="txt">
				@item.title
				 </div>       
        </li>
					
					}
                
      </ul>
      <div class="clear"></div>
    </div>
			<div class="page">
			<ul class="pagination">
					<li><a href="/list/@ViewBag.model.ID">首页</a></li>
					@for (int i = 0; i < pagelist.TotalPages; i++)
					{
						<li><a href="@Url.Action("List","Home",new {page=i+1})" @if(i==pagelist.CurrentPage){@Html.Raw("class=\"active\"");}>@(i+1)</a></li>
					}
				<li><a href="/list/@ViewBag.model.ID?page=@pagelist.TotalPages">尾页</a></li>
				<li><a>第 @pagelist.CurrentPage /@pagelist.TotalPages 页</a></li>
				<li><a>共 @pagelist.TotalItems 条</a></li>
			</ul>
			</div>
  </div>
  <div class="clear"></div>
</div>

		<div id="footer">
			<div class="box">@Html.Raw(ViewBag.model.copyright)</div>
		</div>
	<script type="text/javascript" src="@ViewBag.model.skin/js/foot.js"></script>

</body>
</html>
